apiVersion: v1
kind: BuildConfig
metadata:
  name: discourse2fedmsg
  labels:
    app: discourse2fedmsg
    build: discourse2fedmsg
spec:
  output:
    to:
      kind: ImageStreamTag
      name: discourse2fedmsg:latest
  source:
    type: Git
    git:
      uri: https://github.com/fedora-infra/discourse2fedmsg.git
{% if env == "staging" %}
      ref: staging
{% else %}
      ref: stable
{% endif %}
  strategy:
    type: Source
    sourceStrategy:
      from:
        kind: ImageStreamTag
        namespace: openshift
        name: python:3.6
  triggers:
  - type: ConfigChange
  - type: ImageChange
{% if discourse2fedmsg_stg_webhook_secret is defined and env == 'staging' %}
  - type: GitHub
    github:
      secret: "{{ discourse2fedmsg_stg_webhook_secret }}"
{% endif %}
